﻿using Newtonsoft.Json.Linq;

namespace Neo4jConnect.Traversal
{
    public class JavascriptReturnableEvaluator : ReturnableEvaluator
    {
        private readonly string javascript;

        public JavascriptReturnableEvaluator(string javascript)
        {
            this.javascript = javascript;
        }

        public override JToken ToJson()
        {
            dynamic obj = new JObject();
            obj.language = "javascript";
            obj.body = javascript;
            return obj;
        }
    }
}
